﻿Namespace ViewModel

    Public Class IconViewModel
        Inherits ViewModelBase
        Implements IComparable

        Private ViewModel As LiveProgramViewModel
        Public Sub New(ByVal viewModel As LiveProgramViewModel)
            Me.ViewModel = viewModel
        End Sub

        Public ReadOnly Property Image() As ImageSource
            Get
                Return ViewModel.Station.Icon
            End Get
        End Property

        Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo

            Dim other As IconViewModel = Nothing
            If TryCast(other, IconViewModel) Is Nothing Then
                Return 0
            End If

            If other.ViewModel.Station.Id > Me.ViewModel.Station.Id Then
                Return -1
            ElseIf other.ViewModel.Station.Id < Me.ViewModel.Station.Id Then
                Return 1
            Else
                Return 0
            End If

        End Function
    End Class

End Namespace
